package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.model.entity.InformationListEntity;
import com.runen.infinitemovement.tool.GlideUtils;
import com.runen.infinitemovement.widget.imageview.RoundedCornersImage;

public class ColumnAdapter extends BaseQuickAdapter<InformationListEntity, BaseViewHolder> implements LoadMoreModule {
    private Context context;

    public ColumnAdapter(Context context) {
        super(R.layout.item_column);
        this.context = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, InformationListEntity item) {
        TextView tv_company_activity = helper.getView(R.id.tv_company_activity);
        TextView tv_company_type = helper.getView(R.id.tv_company_type);
        TextView tv_see_num = helper.getView(R.id.tv_see_num);
        TextView tv_comment_num = helper.getView(R.id.tv_comment_num);
        RoundedCornersImage rci_logo = helper.getView(R.id.rci_logo);
        GlideUtils.loadImage(context, item.cover+"?x-oss-process=image/resize,m_fill,w_144,h_144", rci_logo);
        tv_company_activity.setText(item.title);
        tv_see_num.setText(item.readNumber + "浏览");
        tv_comment_num.setText(item.commentNumber + "评论");
        tv_company_type.setText(item.subsidiary);
    }
}
